@startuml
'控制器层
class CameraController{
    - cameraService: CameraService
    + getCameras(): String
    + cameraList(): Map<String, Object>
}
class PopedomController{
        - popedomService: PopedomService
        + getProvinces(): String
        + getCitiesByProvinceId(): String
        + getDistrictsByCityId(): String
        + getBlocksByDistrictId(): String
}
class ResultController{
        - resultService: ResultService
        + analyse(): String
}
class UserController{
        - userService: UserService
        + login(): String
        + userList():  Map<String, Object>
        + logout(): String
}
'业务层
class CameraService{
        - cameraDao: CameraDao
        - popedomDao: PopedomDao
        + getCameras(): List<Camera>
}
CameraController ..> CameraService
class PopedomService{
        - popedomDao: PopedomDao
        + getProvinces(): List<Province>
        + getCitiesByProvinceId(): List<City>
        + getDistrictsByCityId(): List<District>
        + getBlocksByDistrictId(): List<Block>
}
PopedomController ..> PopedomService
class ResultService{
        - resultDao: ResultDao 
        + analyse(): List<Integer> 
}
ResultController ..> ResultService
class UserService{
        - userDao: UserDao
        + login(): User
        + allUsers(): List<User> 
}
UserController ..> UserService
'数据访问对象层
interface CameraDao{
        + selectByBlockId(): List<Camera> 
}
CameraService ..> CameraDao
interface PopedomDao {
        + selectAllProvinces(): List<Province> 
        + selectCitiesByProvinceId(): List<City> 
        + selectDistrictsByCityId(): List<District> 
        + selectBlocksByDistrictId(): List<Block> 
}
CameraService..> PopedomDao
PopedomService ..> PopedomDao
interface ResultDao{
        + selectResults(): List<Boolean> 
}
ResultService ..> ResultDao
class ResultSqlProvider{
        + buildSelectResultsByCameraIdsSql(): String
}
ResultDao ..> ResultSqlProvider
interface UserDao{
        + selectByIdAndPassword(): User 
        + selectAllUsers(): List<User> 
}
UserService ..> UserDao
'POJO
class Block {
    - id: int 
    - districtId: int 
    - name: String 
}
PopedomService ..> Block
PopedomDao ..> Block
class Camera {
    - id: int
    - blockId: int
    - url: String
    - userCount: int
    - working: boolean
}
CameraService ..> Camera
CameraDao ..> Camera
class City {
    - id: int
    - provinceId: int
    - name: String
}
PopedomService ..> City
PopedomDao ..> City
class District {
    - id: int
    - cityId: int
    - name: String
}
PopedomService ..> District
PopedomDao ..> District
class Province {
    - id: int
    - name: String
}
PopedomService ..> Province
PopedomDao ..> Province
class Result {
    - id: int
    - cameraId: int
    - detectTime: Date
    - haveHelmet: Boolean
}
class User {
    - id: int
    - name: String
    - password: String
    - func: int
    - provinceId: int
    - provinceName: String
    - cityId: int
    - cityName: String
    - districtId: int
    - districtName: String
    - blockId: int
    - blockName: String
    - selectedCameraIdList: List<Integer> 
}
UserService ..> User
UserDao ..> User
@enduml